#include <iostream>
#include <vector>
using namespace std;

uint64_t max_mult(string s, int n, int k)
{
        if(k == 0){
                uint64_t nums = 0;
                for(int i = 0; i < n; i++){
                        nums = 10 * nums + s[i] - '0';
                }
                return nums;
        }

        uint64_t mult = 0;
        for(int len = 1; len < n; len++){
                uint64_t nums = 0;
                for(int j = len; j < n; j++){
                        nums = nums * 10 + s[j] - '0';
                }
                mult = max(mult, max_mult(s, len, k - 1) * nums);
        }
        return mult;
}

uint64_t max_mult_val(string &s, int h, int k)
{
        cout<<h<<" "<<k<<endl;
        if(k == 0){
                uint64_t nums = 0;
                for(int i = h; i < s.size(); i++){
                        nums = nums * 10 + s[i] - '0';
                }
                return nums;
        }

        uint64_t max_val = 0;
        for(int i = h + 1; i < s.size(); i++){
                uint64_t nums = 0;
                for(int j = h; j < i; j++){
                        nums = nums * 10 + s[j] - '0';
                }
                max_val = max(max_val, max_mult_val(s, i, k - 1) * nums);
        }

        return max_val;
}

uint64_t max_mult_val_dp(string &s, int k)
{
        int n = s.length();
        vector<vector<vector<int>>> dp(k + 1, vector<vector<int>>(n, vector<int>(n, 0)));
        vector<vector<int>> mult(n, vector<int>(n, 0));
        for(int i = 0; i < n; i++){
                mult[i][i] = s[i] - '0';
                dp[0][i][i] = mult[i][i];
        }
        for(int i = 0; i < n; i++){
                for(int j = i + 1; j < n; j++){
                        mult[i][j] = mult[i][j - 1] * 10 + s[j] - '0';
                        dp[0][i][j] = mult[i][j];
                }
        }

        for(int i = 1; i <= k; i++){
                for(int l = 0; l < n; l++){
                        for(int r = l + 1; r < n; r++){
                                for(int j = l; j < r; j++){
                                        dp[i][l][r] = max(dp[i][l][r], mult[l][j] * dp[i - 1][j + 1][r]); 
                                }
                        }
                } 
        }

        return dp[k][0][n - 1];
}

uint64_t max_mult_dp(string &s, int k)
{
        int n = s.length();
        vector<vector<int>> dp(k + 1, vector<int>(n, 0));
        vector<vector<int>> mult(n, vector<int>(n, 0));

        for(int i = 0; i < n; i++){
                mult[i][i] = s[i] - '0';
        }
        for(int i = 0; i < n; i++){
                for(int j = i + 1; j < n; j++){
                        mult[i][j] = mult[i][j - 1] * 10 + s[j] - '0';
                }
        }

        dp[0][0] = s[0] - '0';
        for(int i = 1; i < n; i++){
                dp[0][i] = dp[0][i - 1] * 10 + s[i] - '0';
        }

        for(int i = 1; i <= k; i++){
                for(int l = 0; l < n; l++){
                        for(int p = 0; p < l; p++){
                                dp[i][l] = max(dp[i][l], dp[i - 1][p] * mult[p + 1][l]);
                        }
                }
        }
        return dp[k][n - 1];
}

int main()
{
        int n, k;
        string s;
        cin>>n>>k;
        cin>>s;
  
        
        //cout<<max_mult_val(s, 0, k)<<endl;
        cout<<max_mult_dp(s, k)<<endl;
        return 0;
}